package com.hc.model.code04.test6;

/**
 * @version v1.0
 * @ClassName: Client
 * @Description: 观察者模式（又叫发布订阅模式）测试
 * @Author: HC
 */
public class Client {

    public static void main(String[] args) {
        // 创建主题对象
        SubscriptionSubject subject = new SubscriptionSubject();
        subject.attach(new WeiXinObserver("张无忌"));
        subject.attach(new WeiXinObserver("杨过"));
        subject.attach(new WeiXinObserver("小龙女"));
        subject.attach(new WeiXinObserver("郭靖"));

        // 通知
        subject.notify("Java课程更新了咯。。");

    }
}
